home *** CD-ROM | disk | FTP | other *** search
- /* fnsplit.c, from page 357 of Turbo C Bible */
- #include <stdio.h>
- #include <stdlib.h>
- main ()
- {
- char pathname [MAXPATH], drive [MAXDRIVE], dir [MAXDIR],
- filename [MAXFILE], ext [MAXEXT];
- /* Prompt user for a complete path name */
- printf ("Enter complete path name to parse:\n");
- gets (pathname); /* Decompose complete path name and
- display result */
- fnsplit (pathname, drive, dir, filename, ext);
- printf ("Drive : %s\n", drive);
- printf ("Directory path: %s\n", dir);
- printf ("Filename : %s\n", filename);
- printf ("Extension : %s\n", ext);
- }